<template>
    <div style="margin-bottom: 60px;">
        <div style="margin: 10px;" v-swiper:mySwiper="swiperOption">
            <div class="swiper-wrapper">
                <div class="swiper-slide" :key="banner" v-for="banner in banners">
                    <img :src="banner">
                </div>
            </div>
            <div class="swiper-pagination"></div>
        </div>

        <div class="row main-entry">
            <div class="col-xs-3" style="padding:0;">
                <a href="/order-list">
                    <img src="../../assets/img/order.jpg">
                    <p>全部订单</p>
                </a>
            </div>
            <div class="col-xs-3" style="padding:0;">
                <a href="/order-list?tab=TabOrderPayment">
                    <img src="../../assets/img/payment_check.jpg">
                    <p>付款确认</p>
                </a>
            </div>
            <div class="col-xs-3" style="padding:0;">
                <a href="/order-list?tab=TabOrderReceipts">
                    <img src="../../assets/img/receipt.jpg">
                    <p>收款确认</p>
                </a>
            </div>
            <div class="col-xs-3" style="padding:0;">
                <a href="/order-ship">
                    <img src="../../assets/img/ship_order.jpg">
                    <p>发货订单</p>
                </a>
            </div>
        </div>

        <div class="main-venue-list">

            <div style="text-align: right;margin-bottom: 10px;"><a style="color: gray" href="">查看更多 ></a></div>

            <div class="main-venue" v-for="item in venues">
                <div class="title">{{item.label}}</div>
                <div class="time">{{item.open_at}}~{{item.close_at}}</div>
                <a :href="'/collection-list/' + item.id">
                    <img :src="item.cover[0]">
                </a>
            </div>


        </div>

    </div>
</template>
<script>
    // import core version + navigation, pagination modules（>= Swiper 6.x）
    import SwiperClass, {Navigation, Pagination, /* add some modules if you need */} from "swiper";
    // configure Swiper to use modules
    SwiperClass.use([Navigation, Pagination]);

    import {Swiper, SwiperSlide, directive} from 'vue-awesome-swiper'

    // ----------------------------------------------------------------------------------------
    // import style of all modules (>= Swiper 6.x)
    // all Swiper styles including all components styles (like Navigation, Pagination, etc.)
    // ----------------------------------------------------------------------------------------
    import 'swiper/swiper-bundle.css'

    // import style of only use module (>= Swiper 6.x)
    // only core Swiper styles
    import 'swiper/swiper.min.css';
    // styles required for Navigation component
    import 'swiper/components/navigation/navigation.min.css';
    // styles required for Pagination component
    import 'swiper/components/pagination/pagination.min.css';

    export default {
        comments: {
            Swiper,
            SwiperSlide
        },
        directives: {
            swiper: directive
        },
        data() {
            return {
                banners: [
                    'https://qianchuzihua.oss-cn-beijing.aliyuncs.com/Venue/1/83/83f9b95b86ecc96cc72c5ff2acca9612.jpg'
                    // 'https://exp-picture.cdn.bcebos.com/a007a9b1eef97fbd48b96b00b74133bad2413318.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1%2Fquality%2Cq_80',
                    // 'https://gss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=edeb22802da446237e9fad64a8125e36/f636afc379310a5533d0860eba4543a983261057.jpg',
                    // 'https://gss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=edeb22802da446237e9fad64a8125e36/f636afc379310a5533d0860eba4543a983261057.jpg',
                ],
                swiperOption: {
                    loop: true,
                    // slidesPerView: 1,
                    // centeredSlides: true,
                    effect: 'fade',
                    pagination: {
                        el: '.swiper-pagination',
                        type: "bullets",
                        // clickable: true,
                        // bulletActiveClass: 'black-bullet-active',
                        currentClass: 'black-bullet-active',
                    },
                },
                venues: [
                    // {
                    //     id: 12,
                    //     name: '字画墨宝',
                    //     label: '字画墨宝',
                    //     open_at: '开放时间:10:00-12:00',
                    //     cover: 'https://exp-picture.cdn.bcebos.com/a007a9b1eef97fbd48b96b00b74133bad2413318.jpg?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_500%2Climit_1%2Fquality%2Cq_80',
                    // }
                ]
            }
        },
        created() {
            // $('body').css('background-color', 'rgb(255,255,255)');
        },
        mounted() {
            this.getVenus();
        },
        methods: {
            getVenus() {
                let that = this;
                this.api.getVenues().then(res => {
                    if (res.data) {
                        that.venues = res.data;
                    }
                })
            }
        },
    }
</script>
<style>

    .swiper-pagination-bullet {
        width: 6px !important;
        height: 6px !important;
    }

    .swiper-pagination-bullet-active {
        background-color: black !important;
    }

    /*.black-bullet-active {*/
    /*    background: #000;*/
    /*    opacity: 2;*/
    /*}*/

    .swiper-pagination {
        position: relative !important;
        margin-top: 10px;
    }

    .swiper-wrapper {
    }

    .swiper-slide img {
        width: 98%;
        margin-left: 1%;
        border-radius: 10px;
        box-shadow: 0 0 8px rgba(100, 100, 100, .5);
    }

    .main-entry {
        margin: 10px;
        text-align: center;
        border-bottom: 1px solid #FAFAFA;
    }

    .main-entry a {
        display: inline-block;
        text-decoration: none;
        color: black;
    }

    .main-entry img {
        width: 36px;
    }

    .main-venue-list {
        margin: 10px;
    }

    .main-venue {
        position: relative;
        margin-bottom: 10px;
    }

    .main-venue .title {
        position: absolute;
        top: 10px;
        left: 20px;
        line-height: 20px;
        padding: 0 20px;
        background-color: white;
        border-radius: 10px;
    }

    .main-venue .time {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0 5px;
        line-height: 20px;
        color: white;
        background-color: rgba(0,0,0, .3);
    }

    .main-venue img {
        width: 98%;
        margin-left: 1%;
        border-radius: 10px;
    }
</style>
